<?php
/**
 * 登录
 */
namespace app\index\controller\applets;
use think\Request;
use app\index\controller\applets\AppletsBase;
use app\index\service\TokenService;
use app\index\model\TempUsers;

class Login extends AppletsBase{


    public function __construct() {


    }

    /**
     * 获取token
     * @return [array]         [数组]
     */
	public function getToken(Request $input){
		/*$result=TempUsers::getTempUsers();
		$token=TokenService::createToken($result->id);
		TokenService::saveToken($token);

		return $this->return_msg(['data'=>['token'=>$token]]);*/
	}

    /**
     * 检查token
     * @return [array]         [数组]
     */
	public function verifyToken(Request $input){
		$result=TokenService::verifyToken($input->token);
		if(!$result){
			return $this->return_err(['msg'=>'token失效']);
		}
		return $this->return_msg();
	}







}
